async = require 'async'

count = 0



test = ()->
  if count < 5 then return true

fn=(cb)->
  count++
  console.log count
  cb null,count

cb=(err,result)->
  console.log 'the result is:',result

async.whilst test,fn,cb
